package org.wombat.service;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Service;
import org.wombat.model.User;
import org.wombat.model.UserCache;
import javax.annotation.Resource;

/**
 * Created by IntelliJ IDEA.
 * User: rovsipet
 * Date: 24-11-2010
 * Time: 08:16:28
 * To change this template use File | Settings | File Templates.
 */

public class UserServiceImpl implements IUserService{

    private UserCache cache;

    @Required
    @Resource(name="userCache")
    public void setCache(UserCache cache) {this.cache = cache;}

    @Override
    public User getUser(String username) {
        return cache.getUserByUsername(username);
    }

    @Override
    public boolean addNewUser(User user) {
        return cache.addUser(user);  
    }
}
